home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_a / ezclok.doc < prev    next >
Text File  |  1995-04-22  |  3KB  |  106 lines

  1.    EZCLOK.XMO is a machine language
  2. utility that allows easy access to the
  3. Atari system clocks. It was written to
  4. eliminate the need for the messy
  5. calculations often  required when
  6. using the built in system clock
  7. (Locations 18,19,and 20). Clock access
  8. is performed by doing simple string
  9. manipulations.
  10.  
  11.              HOW IT WORKS
  12.  
  13.    The actual interrupt handler
  14. occupies page six of memory and writes
  15. to the first 14 bytes of the
  16. string-array area. The bytes are
  17. arranged as follows
  18.  
  19. First 3 bytes.....[AM ] (or PM)
  20. Bytes 4 thru 11...[HH:MM:SS]
  21. Bytes 12 thru 14..[:JJ] (jiffies)
  22.  
  23.  
  24.    The time can be set or read all at
  25. once or in segments depending on how
  26. you initialize the strings. To set or
  27. read everything at once, you must
  28. DIMension the first string in your
  29. program to 14 bytes-- eg. DIM T$(14).
  30. You must then set the time by setting
  31. the string equal to whatever value
  32. (time) you wish.
  33.  
  34.                EXAMPLE:
  35.  
  36. POKE 1730,1:REM turn clock off
  37. T$="PM 10:30:45:00"
  38.       (HH:MM:SS:JJ)
  39. POKE 1730,0:REM turn clock on
  40.  
  41. POKE 1730,1 turns off the timer and
  42. should always be used when setting the
  43. clock to ensure reliable operation.
  44. This location can also be used to
  45. start and stop the clock at will. To
  46. read the clock simply read T$ as you
  47. would any other string variable--eg.
  48. PRINT T$. For a different approach,
  49. you can DIMension your strings in the
  50. following manner.
  51.  
  52. DIM AMPM$(3):REM AM or PM
  53. DIM T$(8):REM HH:MM:SS
  54. DIM JIF$(3):REM jiffies 
  55.  
  56. You can now set or read the hours,
  57. minutes, and seconds without worrying
  58. about whether it is AM or PM or the
  59. jiffies(sixtieths of a second). By the
  60. way, it is the ORDER in which these
  61. strings are TYPED in --not their
  62. names-- which determine what they will
  63. be used for. By the way, all of these
  64. strings must be initialized, even if
  65. they all aren't used.
  66.  
  67.           USING THE PROGRAM
  68.  
  69.    To use the clock in one of your own
  70. programs, type in the following.
  71.  
  72. LOAD "D:EZCLOK.XMO"
  73. LIST "D:EZCLOK.SUB",20000,20080
  74. NEW
  75. ENTER "D:EZCLOK.SUB"
  76. SAVE "D:EZCLOK.SUB"
  77.  
  78.  
  79.    There is no need to leave this
  80. subroutine in listed form. In fact, if
  81. you have a program already written and
  82. you would like to add the clock, you
  83. should LIST YOUR PROGRAM to disk, LOAD
  84. the EZCLOK.SUB routine, then you can
  85. enter YOUR program. Then add GOSUB
  86. 20000 to the beginning of your
  87. program. I know this seems backwards,
  88. but it will not work the other way
  89. around.
  90.  
  91.    As a final note, there is a nice
  92. little memory move function built into
  93. this subroutine. It can be called by
  94. typing,
  95.  
  96. X=USR(ADR(MOVE$),from,to,#bytes)
  97.  
  98.  
  99.    I hope this program has been
  100. helpfull in some way. Please let me
  101. know if you find any use for it. I am
  102. also interested in any comments you
  103. might have.
  104.                  thanx
  105.                  mike  74005,475
  106.